import axios from "axios";
export function request(config) {
    const instance = axios.create({
        //请求域名
        baseURL: 'https://api.shop.eduwork.cn/',
        timeout: 5000
    })
    instance.interceptors.request.use(config => {
        return config
    }, err => {
        console.log(err)
    })
    instance.interceptors.response.use(res => {
        return res.data ? res.data : res;
    }, err => {
        alert(err.response.data.errors[Object.keys(err.response.data.errors)[0]][0])
    })
    return instance(config)
}